<template>
  <router-view :key="route.fullPath" />
</template>

<script setup lang="ts">
import bus from '@/utils/bus'
import { LocationQueryRaw } from 'vue-router'

const route = useRoute()
const router = useRouter()
bus.$on('changeRoute', (path: string, query?: LocationQueryRaw) => {
  // 监听子组件的路由通信
  router.push({ path, query })
})
</script>

<style lang="less" scoped></style>
